package com.aaa.sas.service;


import com.aaa.sas.dao.AccountDaosas;
import com.aaa.pojo.Pagesas;
import com.aaa.pojo.ResultBeansas;
import com.aaa.pojo.question_sas;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class AccountServicesasimpl implements AccountServicesas{
    @Autowired
    private AccountDaosas accountDaosas;
    @Override
    public ResultBeansas findAll(Pagesas pagesas,question_sas question_sas) {
        PageHelper.startPage(pagesas.getPage(), pagesas.getLimit());
        List<question_sas> list = accountDaosas.findAll(question_sas);
        PageInfo<question_sas> pageInfo=new PageInfo<question_sas>(list);
        return new ResultBeansas(0,"查询成功",pageInfo.getTotal(),pageInfo.getList());
    }
    @Override
    public Integer delete (@Param("id") Integer id ) {
       return accountDaosas.delete(id);
    }

    @Override
    public Integer update(question_sas question_sas) {
        return accountDaosas.update(question_sas);
    }

    @Override
    public Integer deletes(@Param("id") Integer[] id) {
        return accountDaosas.deletes(id);
    }

    @Override
    public Integer save(question_sas question_sas) {
        return accountDaosas.save(question_sas);
    }
}
